package com.tjetc.自定义序列化;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class TestUser {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream("user.txt"));
        User user = new User("张三", 20);
        objectOutputStream.writeObject(user);
        objectOutputStream.close();
    }
}
